package baiwa.rta.dao.mapping;

import baiwa.rta.model.RMcddtlModel;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper;


public class ConciergeDepositDetailMapping implements RowMapper<RMcddtlModel> {

    public RMcddtlModel mapRow(ResultSet rs, int line) throws SQLException {
        ResultSetExtractor<RMcddtlModel> extractor = new ResultSetExtractor<RMcddtlModel>() {
            public RMcddtlModel extractData(ResultSet rs) throws SQLException, DataAccessException {
                
                RMcddtlModel model = new RMcddtlModel();
                model.setCddid(rs.getInt("CDDID"));
                model.setCdhid(rs.getInt("CDHID"));
                model.setCdhdocno(rs.getString("CDHDOCNO"));
                model.setCdddesc(rs.getString("CDDDESC"));
                model.setCddqty(rs.getString("CDDQTY"));
                model.setCddremark(rs.getString("CDDREMARK"));
                model.setCddcreby(rs.getString("CDDCREBY"));
                model.setCddcredat(rs.getDate("CDDCREDAT"));
                model.setCddupdby(rs.getString("CDDUPDBY"));
                model.setCddupddat(rs.getDate("CDDUPDDAT"));
                
                return model;
            }
        };
        return extractor.extractData(rs);
    }
}
